package com.tarena.lbs.business.dao.repository.impl;

import com.tarena.lbs.business.dao.mapper.BusinessMapper;
import com.tarena.lbs.business.dao.repository.BusinessRepository;
import com.tarena.lbs.business.pojo.po.BusinessPO;
import com.tarena.lbs.business.pojo.query.BusinessQuery;
import com.tarena.lbs.business.pojo.vo.BusinessVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
@Slf4j
@Repository
public class BusinessRepositoryImpl implements BusinessRepository {
    @Autowired
    private BusinessMapper businessMapper;
    @Override
    public List<BusinessPO> List(BusinessQuery query) {
        List<BusinessPO> pos=businessMapper.selectBusinessById(query);
        log.debug("查询结果：{}",pos);
        return pos;
    }
    @Override
    public void insert(BusinessPO businessPO) {
        System.out.println(""+businessPO);
        businessMapper.insert(businessPO);
    }

    @Override
    public List<BusinessPO> list(BusinessQuery query) {
        return null;
    }

    @Override
    public List<BusinessVO> selectList(BusinessQuery query) {
        List<BusinessVO> list=businessMapper.selecto( query);
        return list;
    }

    @Override
    public BusinessPO selectById(Integer id) {
        BusinessPO po=businessMapper.selectByIdo(id);
        return po;
    }
}
